﻿public class HomeWork {

	public static void main(String[] args) {
		int x=9;
		for (int i = 1; i <= x; i++) {
			if(i==1){
				for(int j = 1;j <= 2*x-1; j++){
					if(j>=1&&j<=x||j==2*x-1){
						System.out.print("*");
					}else{
						System.out.print(" ");
					}
				}
			}
			if(i>=2&&i<=(x+1)/2-1){
				for(int j = 1;j <= 2*x-1; j++){
					if(j==x||j==2*x-1){
						System.out.print("*");
					}else{
						System.out.print(" ");
					}
				}
			}
			if(i==(x+1)/2){
				for (int j = 1; j <= 2*x-1; j++) {
					System.out.print("*");
				}
			}
			if(i>=(x+1)/2+1&&i<=x-1){
				for(int j = 1;j <= 2*x-1; j++){
					if(j==1||j==x){
						System.out.print("*");
					}else{
						System.out.print(" ");
					}
				}
			}
			if(i==x){
				for(int j = 1;j <= 2*x-1; j++){
					if(j>=x&&j<=2*x-1||j==1){
						System.out.print("*");
					}else{
						System.out.print(" ");
					}				
				}
			}					
			System.out.println();
		}		
	}
}